﻿using Admin.NET.Core;

namespace Admin.NET.Application.Entity;

/// <summary>
/// 设备模板信息
/// </summary>
[SugarTable("DeviceTemplateInfo", "设备模板信息")]
public class DeviceTemplateInfo : EntityBase
{
    /// <summary>
    /// 离线时间
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "CusdeviceOfflineDecision", ColumnDescription = "离线时间")]
    public int CusdeviceOfflineDecision { get; set; }

    /// <summary>
    /// 是否多从机
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "MultiSlaveMode", ColumnDescription = "是否多从机")]
    public bool MultiSlaveMode { get; set; }

    /// <summary>
    /// 轮询方式
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "PollingMethod", ColumnDescription = "轮询方式")]
    public PollingMethod PollingMethod { get; set; }

    /// <summary>
    /// 状态配置
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "StateConfiguration", ColumnDescription = "状态配置")]
    public StateConfiguration StateConfiguration { get; set; }

    /// <summary>
    /// 模板名称
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "TemplateName", ColumnDescription = "模板名称", Length = 100)]
    public string TemplateName { get; set; }

    /// <summary>
    /// 直属机构Id
    /// </summary>
    [SugarColumn(ColumnDescription = "直属机构Id")]
    public long OrgId { get; set; }

    /// <summary>
    /// 直属机构
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(OrgId))]
    public SysOrg SysOrg { get; set; }

    [SugarColumn(IsIgnore = true)]
    [Navigate(NavigateType.OneToMany, nameof(DeviceSlaveTemplate.DeviceTemplateInfoId))]
    public List<DeviceSlaveTemplate> DeviceSlaveTemplates { get; set; }
}